#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QLabel>
#include "VerifyCodeWidget.h"
namespace Ui {
class Login;
}

class Login : public QLabel
{
    Q_OBJECT

public:
//    bool eventFilter(QObject *watched,QEvent *event) override;
    enum Mode {
        // keep this in sync with QMessageDialogOptions::Icon
        userMode = 0,
        adminMode = 1
    };
    Mode nowMode;
    explicit Login(QWidget *parent = nullptr);
    ~Login();


private slots:
    void on_loginBut_clicked();

    void on_enrollBut_clicked();

    void on_closeBut_clicked();


    void on_comboBox_currentTextChanged(const QString &arg1);

    void on_rotSBut_clicked();

    void on_verifyButton_clicked();

    void on_minimizeBut_clicked();

    void on_maximizeBut_clicked();

private:
    Ui::Login *ui;
     VerifyCodeWidget *captchaWidget;
    QSqlDatabase db;
    void userXY();
    void toggleMaximizeRestore();
    QString generateCaptcha();
    QString captchaCode;
    bool RotORP;
};


#endif // LOGIN_H
